clip = priv->clip;
shift_allocation (gadget, &clip);
- if (gtk_snapshot_clips_rect (snapshot, &GRAPHENE_RECT_INIT(clip.x, clip.y, clip.width, clip.height)))
+ if (gtk_snapshot_clips_rect (snapshot, &clip))
return;
gtk_css_gadget_get_margin_box (gadget, &margin_box);
GtkCssImageLinear *linear = GTK_CSS_IMAGE_LINEAR (image);
GskColorStop *stops;
GskRenderNode *node;
- double off_x, off_y; /* snapshot offset */
+ int off_x, off_y; /* snapshot offset */
double angle; /* actual angle of the gradiant line in degrees */
double x, y; /* coordinates of start point */
double length; /* distance in pixels for 100% */
{
GskRoundedRect outline;
GskRenderNode *node;
- double off_x, off_y;
+ int off_x, off_y;
g_return_if_fail (shadow->class == >K_CSS_VALUE_SHADOW);
{
GskRoundedRect outline;
GskRenderNode *node;
- double off_x, off_y;
+ int off_x, off_y;
g_return_if_fail (shadow->class == >K_CSS_VALUE_SHADOW);
for (icons = icon_view->priv->items; icons; icons = icons->next)
{
GtkIconViewItem *item = icons->data;
+ cairo_rectangle_int_t area;
- if (!gtk_snapshot_clips_rect (snapshot,
- &GRAPHENE_RECT_INIT (
- item->cell_area.x - icon_view->priv->item_padding,
- item->cell_area.y - icon_view->priv->item_padding,
- item->cell_area.width + icon_view->priv->item_padding * 2,
- item->cell_area.height + icon_view->priv->item_padding * 2
- )))
+ area.x = item->cell_area.x - icon_view->priv->item_padding;
+ area.y = item->cell_area.y - icon_view->priv->item_padding;
+ area.width = item->cell_area.width + icon_view->priv->item_padding * 2;
+ area.height = item->cell_area.height + icon_view->priv->item_padding * 2;
+
+ if (!gtk_snapshot_clips_rect (snapshot, &area))
{
gtk_icon_view_snapshot_item (icon_view, snapshot, item,
item->cell_area.x, item->cell_area.y,
{
GskRoundedRect offset_outline;
GskRenderNode *node;
- double off_x, off_y;
+ int off_x, off_y;
if (hidden_side)
{
gtk_snapshot_state_new (GtkSnapshotState *parent,
char *name,
cairo_region_t *clip,
- double translate_x,
- double translate_y,
+ int translate_x,
+ int translate_y,
GtkSnapshotCollectFunc collect_func)
{
GtkSnapshotState *state;
**/
void
gtk_snapshot_get_offset (GtkSnapshot *snapshot,
- double *x,
- double *y)
+ int *x,
+ int *y)
{
if (x)
*x = snapshot->state->translate_x;
*/
gboolean
gtk_snapshot_clips_rect (GtkSnapshot *snapshot,
- const graphene_rect_t *bounds)
+ const cairo_rectangle_int_t *rect)
{
- graphene_rect_t offset_bounds;
- cairo_rectangle_int_t rect;
+ cairo_rectangle_int_t offset_rect;
if (snapshot->state->clip_region == NULL)
return FALSE;
- graphene_rect_offset_r (bounds, snapshot->state->translate_x, snapshot->state->translate_y, &offset_bounds);
- rectangle_init_from_graphene (&rect, &offset_bounds);
+ offset_rect.x = rect->x + snapshot->state->translate_x;
+ offset_rect.y = rect->y + snapshot->state->translate_y;
+ offset_rect.width = rect->width;
+ offset_rect.height = rect->height;
- return cairo_region_contains_rectangle (snapshot->state->clip_region, &rect) == CAIRO_REGION_OVERLAP_OUT;
+ return cairo_region_contains_rectangle (snapshot->state->clip_region, &offset_rect) == CAIRO_REGION_OVERLAP_OUT;
}
/**
int y);
GDK_AVAILABLE_IN_3_90
void gtk_snapshot_get_offset (GtkSnapshot *snapshot,
- double *x,
- double *y);
+ int *x,
+ int *y);
GDK_AVAILABLE_IN_3_90
void gtk_snapshot_append_node (GtkSnapshot *snapshot,
GDK_AVAILABLE_IN_3_90
gboolean gtk_snapshot_clips_rect (GtkSnapshot *snapshot,
- const graphene_rect_t *bounds);
+ const cairo_rectangle_int_t *bounds);
GDK_AVAILABLE_IN_3_90
void gtk_snapshot_render_background (GtkSnapshot *snapshot,
GPtrArray *nodes;
cairo_region_t *clip_region;
- double translate_x;
- double translate_y;
+ int translate_x;
+ int translate_y;
GtkSnapshotCollectFunc collect_func;
union {
GtkCssValue *filter_value;
RenderMode mode;
double opacity;
+ cairo_rectangle_int_t offset_clip;
if (_gtk_widget_get_alloc_needed (widget))
return;
priv = widget->priv;
- graphene_rect_init (&bounds, priv->clip.x - priv->allocation.x,
- priv->clip.y - priv->allocation.y,
- priv->clip.width, priv->clip.height);
- if (gtk_snapshot_clips_rect (snapshot, &bounds))
+ offset_clip = priv->clip;
+ offset_clip.x -= priv->allocation.x;
+ offset_clip.y -= priv->allocation.y;
+
+ if (gtk_snapshot_clips_rect (snapshot, &offset_clip))
return;
if (_gtk_widget_is_toplevel (widget))
filter_value = _gtk_style_context_peek_property (_gtk_widget_get_style_context (widget), GTK_CSS_PROPERTY_FILTER);
gtk_css_filter_value_push_snapshot (filter_value, snapshot);
+ graphene_rect_init (&bounds,
+ offset_clip.x,
+ offset_clip.y,
+ offset_clip.width,
+ offset_clip.height);
+
if (mode == RENDER_DRAW)
{
cairo_t *cr;